<template>
	<wd-navbar
		fixed
		placeholder
		:title="title"
		safeAreaInsetTop
		:bordered="false"
	>
		<template #capsule>
			<wd-navbar-capsule @back="handleBack" @back-home="handleBackHome" v-if="capsule"/>
		</template>
	</wd-navbar>
</template>

<script setup>
	const props = defineProps({
		title: {
			type: String,
			default: 'capsule'
		},
		search: {
			type: Boolean,
			default: false
		},
		capsule: {
			type: Boolean,
			default: true
		}
	})
	function handleBack() {
	  uni.navigateBack({})
	}
	
	function handleBackHome() {
	  uni.reLaunch({ url: '/pages/index/index' })
	}
</script>

<style lang="scss" scoped>
	:deep(.wd-search) {
		padding: 0;
	}
</style>